/**
 * @Author: Bobby
 * @Date: 2022-02-15 13:14:17
 * @LastEditTime: 2022-03-24 11:30:14
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\ve\common\components\baseComs\form\uiInput.js
 * @CIMC-V2
 */
import {
  exInput,
  exSwitch,
  exSizeSelect,
  exSelect,
  exRadioGroup,
  exValidateSelect,
  exIcon,
  exColorPicker,
  exTextarea,
  exPresetText,
} from '@ve/common/components/extension'
import { constantTip } from '@ve/common/components/extension/tip'
import { translateTitle } from '@/utils/i18n'
export default {
  VERSION: '20220408',
  type: 'uiInput',
  name: '输入框',
  icon: 'input-cursor-move',
  svg: 'danhangshurukuang',
  //数据别名
  // dataName: 'uiInput_data',
  //数据集合 表单 列表等等
  data: {
    requestData: {},
  },
  extension: {
    model: exInput('Model', 'input_name'),
    label: exInput('标签', '输入框'),
    //rule: exSwitch('验证', false),
    extendRule: exValidateSelect('', {}, []),
    // ...exDivider(0),
    type: exRadioGroup('类型', 'text', [
      {
        value: 'text',
        label: '输入框',
      },
      {
        value: 'password',
        label: '密码框',
      },
      {
        value: 'textarea',
        label: '多行文本',
      },
    ]),
    presetText: { ...exPresetText('', false), isSuperior: true },
    // ...exDivider(1),
    tooltip: { ...exTextarea('弹窗提示', '', '', 3), isSuperior: true },
    size: exSizeSelect('尺寸', 'mini'),
    placeholder: { ...exInput('提示', translateTitle('Ve.elements.请输入')), isSuperior: true },
    placeholderColor_v1: { ...exColorPicker('提示字体颜色', '#555'), isSuperior: true },
    suffixIcon: exIcon('后置图标', ''),
    prefixIcon: exIcon('前置图标', ''),
    // append: exInput('后缀内容', ''),
    append: {
      type: 'exInputExpend',
      name: '后缀内容',
      modelType: 'append',
      value: {
        type: 'text',
        defaultValue: '',
        Model: '',
        api: '',
        method: '',
        getDataKey: '',
        requestData: [],
        labelField: 'label',
        valueField: 'value',
        optionConfig: [],
      }
    },
    // prepend: exInput('前缀内容', ''),
    prepend: {
      type: 'exInputExpend',
      name: '前缀内容',
      modelType: 'prepend',
      value: {
        type: 'text',
        defaultValue: '',
        Model: '',
        api: '',
        method: '',
        getDataKey: '',
        requestData: [],
        labelField: 'label',
        valueField: 'value',
        optionConfig: [],
      }
    },
    width: { ...exInput('宽度', 'auto', '填写数字:单位px,auto:自动宽度'), isSuperior: true },
    labelWidth: { ...exInput('label宽度', 'auto', '填写数字:单位px,auto:自动宽度'), isSuperior: true },
    fontSize: exInput('文字大小', '12px', '文字大小以px为单位'),
    textColor: exColorPicker('字体颜色', '#000000'),
    bgColor: exColorPicker('背景颜色', '#ffffff'),
    fontWeight: exSelect('字体粗细', 'font-thin', [
      { value: 'font-thin', label: '默认' },
      { value: 'font-extralight', label: '200' },
      { value: 'font-light', label: '300' },
      { value: 'font-normal', label: '400' },
      { value: 'font-medium', label: '500' },
      { value: 'font-semibold', label: '600' },
      { value: 'font-bold', label: '700' },
      { value: 'font-extrabold', label: '800' },
      { value: 'font-black', label: '900' },
    ]),
    disabled: exSwitch('禁用', false),
    hidden: exSwitch('隐藏', false),
    defaultValue: exInput('默认值', '', constantTip()),
    ignoreClearValue: { ...exSwitch('忽略清空', false, '开启后清空表单会保留默认值'), isSuperior: true },
    isCopyComma: { ...exSwitch('复制是否开启逗号分割', true, '只对文本域有效'), isSuperior: true },
    enterSelect: {
      type: 'exModuleSelect',
      name: '回车选中',
      value: [],
      hasCheckbox: false,
      treeData: '$getPageModules',
      isSuperior: true,
    },
  },
  //交互
  interaction: [],
  //条件、逻辑指令
  logicInstruction: [],
}
